import http from '@/utils/http'; 

// 宠物列表接口
export function getPetListAPI(){
    return http({
        url:"/pet-adopt/admin/pet-list"
    })
}

// 模糊搜索-狗列表
export function getDogListAPI(){
    return http({
        url:"/pet-adopt/admin/pet-list?species=狗"
    })
}

// 模糊搜索-猫列表
export function getCatListAPI(){
    return http({
        url:"/pet-adopt/admin/pet-list?species=猫"
    })
}

//模糊搜索-其他宠物列表 
// 模糊搜索-猫列表
export function getOrherListAPI(){
    return http({
        url:"/pet-adopt/admin/pet-list?species=其他"
    })
}

// 宠物详情接口
export function getPetDetails(){
    return http({
        url:"/pet-adopt/pets"
    })
}

// 上传图片接口
export function postImageAPI(formData){
    return http({
        url:'/upload/image',
        method:"post",
        data:formData
    })
}

// 发布宠物接口
export function publishPetInfo(data) {
    const publisherId = data.publisher_id;
    return http({
        url: `/pet-adopt/pets/publish?publisherId=${publisherId}`,
        method: 'post',
        data
    });
}

// 宠物详情接口：
export function getPetDetailAPI(pet_id){
    return http({
        url:'/pet-adopt/pets/detail',
        params:{
            pet_id
        }
    })
}

// 领养宠物接口-发送申请接口 form表单：存储申请信息
export function postPetAdoptApplicationAPI(form){
    return http({
        url:"/pet-adopt/apply-application",
        method:"post",
        data:form
    })
}

// 宠物捐款：
export function postPetDonationAPI(data){
    return http({
        url:'/pet-adopt/donation',
        method:"post",
        data:data
    })
}

// 捐款搜索接口-公示捐款
export function getDonateListAPI(){
    return http({
        url:"/pet-adopt/finance/list"
    })
}

// 宠物搜索接口
export function PetSearchAPI(params: any){
    return http({
        url: "/pet-adopt/pets/search",
        method: "get",
        params
    })
}